const dbJQL = uniCloud.databaseForJQL()
module.exports = {
	_before: function() { // 通用预处理器
	},
	async addArticles(params = {}) {
		let res = await dbJQL.collection("demo-articles")
			.add(params)
		console.log(res);
		return res;
	},
	async getArticlesWithUser() {
		let res = await dbJQL.collection("demo-articles,demo-user")
			.where("demo-articles.user_id == demoUser._id")
			.field("demo-articles._id, demo-articles.description, demo-articles.picurl, demo-user.name")
			.get();
		console.log(res);
		return res;
	}
}